package cn.waka.sys.admin.object;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

import org.springframework.data.annotation.TypeAlias;

@TypeAlias("Node")
public class Node {
    private int id;
    private String node;
    private String title;
    private boolean isMenu;
    private boolean isAuth;
    private Timestamp create_at;
    private int pid;
    private boolean checked;
    private List<Node> children;

    private String key;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getNode() {
        return node;
    }

    public void setNode(String node) {
        this.node = node;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isMenu() {
        return isMenu;
    }

    public void setMenu(boolean isMenu) {
        this.isMenu = isMenu;
    }

    public boolean isAuth() {
        return isAuth;
    }

    public void setAuth(boolean isAuth) {
        this.isAuth = isAuth;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public Timestamp getCreateAt() {
        return create_at;
    }

    public void setCreateAt(Timestamp create_at) {
        this.create_at = create_at;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    public List<Node> getChildren() {
        return children;
    }

    public void setChildren(List<Node> children) {
        this.children = children;
    }

    public void add(Node child) {
        if (children == null) {
            children = new ArrayList<Node>();
        }
        children.add(child);
    }

    @Override
    public String toString() {
        return "Node [id=" + id + ", node=" + node + ", title=" + title + ", isMenu=" + isMenu + ", isAuth=" + isAuth
                + ", create_at=" + create_at + ", pid=" + pid + "]";
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }


}
